An efficient energy management scheme using rule-based swarm intelligence approach to support pulsed load via solar-powered battery-ultracapacitor hybrid energy system

This work presents an energy management scheme (EMS) based on a rule-based grasshopper optimization algorithm (RB-GOA) for a solar-powered battery-ultracapacitor hybrid system. The main objective is to efficiently meet pulsed load (PL) demands and extract maximum energy from the photovoltaic (PV) array. The proposed approach establishes a simple IF-THEN set of rules to define the search space, including PV, battery bank (BB), and ultracapacitor (UC) constraints. GOA then dynamically allocates power shares among PV, BB, and UC to meet PL demand based on these rules and search space. A comprehensive study is conducted to evaluate and compare the performance of the proposed technique with other well-known swarm intelligence techniques (SITs) such as the cuckoo search algorithm (CSA), gray wolf optimization (GWO), and salp swarm algorithm (SSA). Evaluation is carried out for various cases, including PV alone without any energy storage device, variable PV with a constant load, variable PV with PL cases, and PV with maximum power point tracking (MPPT). Comparative analysis shows that the proposed technique outperforms the other SITs in terms of reducing power surges caused by PV power or load transition, oscillation mitigation, and MPP tracking. Specifically, for the variable PV with constant load case, it reduces the power surge by 26%, 22%, and 8% compared to CSA, GWO, and SSA, respectively. It also mitigates oscillations twice as fast as CSA and GWO and more than three times as fast as SSA. Moreover, it reduces the power surge by 9 times compared to CSA and GWO and by 6 times compared to SSA in variable PV with the PL case. Furthermore, its MPP tracking speed is approximately 29% to 61% faster than its counterparts, regardless of weather conditions. The results demonstrate that the proposed EMS is superior to other SITs in keeping a stable output across PL demand, reducing power surges, and minimizing oscillations while maximizing the usage of PV energy.

times as quickly as the compared algorithms.Furthermore, in the variable PV with PL case, it minimizes the power surge by 6 to 9 times.Additionally, its MPP tracking speed is roughly 29% to 61% faster than other SITs compared under uniform irradiance and shaded conditions.These results demonstrate the superiority of the proposed technique over the other SITs in maintaining constant output across PL demand and optimizing the use of PV energy.
The proposed work addresses critical challenges in a solar-powered BB-UC hybrid system, specifically high response times, output fluctuations, and the efficient integration of PV energy with ESDs.The research introduces an EMS based on RB-GOA to optimize real-time power share between PV system, BB, and UCs.The EMS includes both long-term energy management and short-term power management to adapt to the dynamic nature of PV systems.Furthermore, an optimized MPPT scheme is presented to tackle variation of solar irradiance to maximize the energy harvesting from the PV array.Comparative analysis of RB-GOA with other SITs highlights its superior performance in terms of power surge reduction, oscillation mitigation, and MPPT speed.The proposed system contributes in providing the improved and reliable performance of solar-powered BB-UC HESS under dynamic real-world conditions, which can significantly impact the field of PV energy and energy management.
The rest of the work is divided into the following sections: The modeling of components of the hybrid system is presented in "Modeling of system components" section."Problem formulation" section presents the formulation of a control problem with an objective function."Set of rules" section outlined the set of rules.GOA is explained in "Grasshopper optimization algorithm" section.The combination of the rule-based control and GOA is presented in "Rule-based GOA" section and parameters selection of the SITs used is given in "Parameters selection of SITs" section.Simulation results for various case studies are presented in "Results and discussions" section.Finally, the conclusion is presented in "Conclusion" section.

Modeling of system components
Figure 1 shows the proposed system in which a boost converter is used to link the PV system to the DC link.The energy storage devices (ESDs) comprise a combination of BB and UC, both of which are connected to the DC link through their respective bidirectional converters.The three sources collaborate to power the PL.PV energy serves as the primary source; the battery is used to compensate for a power shortage or store surplus power; and the UC is used to compensate for instantaneous load variation.The MPPT technique is used to extract the maximum power from PV via the boost converter.A rule-based algorithm controls each bidirectional converter, managed by an energy management system (EMS).

PV system modeling
A PV system is composed of a PV array, a boost converter, and a GOA-based MPPT algorithm, as shown in Fig. 1.The main objective of this PV system is to extract the maximum available energy from the PV array, irrespective of the ecological conditions.The output current (I pv ) Eq. (1) of a PV module is obtained by its single-diode model 6,18,24 .The main external factors that affect I pv are incident irradiance (G) and temperature (T).In addition, internal factors that can significantly reduce its output are series resistance (R s ) and shunt resistance (R sh ) .R s is resistance to current flow, which is due to the ohmic contact between the metal and the internal resistance of the semiconductor, and R sh shows a leakage current that depends on the quality of the module surface 32 .
I sc : short circuit current of the modules with its temperature coefficient α sc , T r , G r : reference temperature and solar insolation respectively, I sr , n: reference saturation current and non-ideality factor of the diode, respectively, E G : band gap energy of the cell material, V pv : module voltage, k: Boltzmann's constant, q: charge on an electron, N p : the number of parallel solar cells, and N s : the number of cells in series.The power of a single PV module ( P mod ) is given in Eq. (2) 2 .
The output power of the PV array (P pv ) given in Eq. ( 3) is obtained by connecting the PV modules (N pv ) in vari- ous combinations. (1)

Battery bank modeling
BB is a high-energy density device that is used as a backup power source to run the load when PV energy is not available 5 .It reduces the negative effects of the intermittent behavior of PV power by storing surplus energy.A bidirectional converter ( BDC b ) is used to link a BB to a common DC link in the circuit model depicted in Fig. 1.A macroscopic modeling method is sufficient for BB sizing since the goal is not to examine the internal chemistry of the BB.Therefore, for this work, an equivalent electrical model of the battery based on the Rint structure is used.It consists of an internal resistance connected in series with a variable open-circuit voltage that depends on the state of charge ( SoC b ) and temperature 23 .SoC b states the remaining stored energy in the BB.Therefore, it is considered a crucial metric in the analysis of BB under various operational circumstances.It is updated using the Coulomb counting (CC) approach with the following formula in Eq. ( 4) 33,34 .
where SoC 0 b is the initial SoC b , Q b is the capacity of the BB, and I b is the current taken or supplied through the BB.The sign of I b is positive when the BB is supplying power to the load and negative when the BB is being charged.In this work, the lithium-ion battery block model available in MATLAB/Simulink is used.The minimum power www.nature.com/scientificreports/needed (Req_BB_Pwr) by BB to raise SoC b (t) to an upper limit ( SoC u b ) in the time step t with N b , the number of batteries is given by Eq. ( 5) 35 .
Similarly, the remaining power of the battery (Eq.6) is the maximum power that can be continuously delivered for the time step t before SoC b (t) approaches its lower limit SoC l b .

Ultracapacitor modeling
Electric double-layer capacitors (EDLCs), UCs, or SCs are energy storage capacitors.Both batteries and UCs are electrochemical devices, but no electrochemical reaction occurs in the energy storage mechanism of UCs.UCs store energy electrostatically by polarizing an electrolytic solution.This dissimilar operating principle of UCs makes its features very different from the battery.UCs possess a considerably high power density, low energy density, high charge-discharge efficiency, and more than a million cycles of life 21 .They can operate efficiently from − 40 °C to + 70 °C.Energy storage in UCs has a direct relation with the square of their terminal voltage (V uc ) and can be calculated using Eq. (7).
where E uc is the stored energy in Joules, C uc is the capacitance in Farads, V uci is the initial voltage, and V ucf is the final voltage across the UC terminals in volts, P uc is the power in watts and t is the discharge time in seconds.
Energy can be obtained between the rated volts and zero volts, so 100% stored energy can be hypothetically extracted but 5% energy is dissipated in heat 20 .However, a designer keeps a protection boundary to avoid the reverse charge of unstable cells.

Problem formulation
The main objective is to meet the pulsed load demand ( P dem ) within the specified limits and to get maximum PV energy under all weather conditions.To achieve the objective, a multilevel EMS is presented, focusing on two key aspects of interest.The first aspect is to support PL demands and ensure UC charging through BB.This is managed by creating two independent management layers: a long-term energy management layer (EML) and a short-term power management layer (PML).EML narrows the search space with the help of a set of IF-THEN rules.PML produces reference signals with the help of GOA to control BDC i using these rules and the search space defined by EML.The search space contains the operating limits of the components.The central equation to fulfill P dem (t) at any instant t is given in Eq. ( 9).
Here, P i (t) is the power supplied by the i th component and C i (t) is the capacity assignment factor for better power management between components 36 .C i (t) is restricted by the limits of the upper bound UB i and the lower bound where LBi ≥ −1 and UB i ≤ 1 .The UB i defines the discharging ability and the LB i describes the charging ability of the component.Typical values of the bounds are LB i ∈ [−1, 0] for charging and UB i ∈ [0, 1] for discharging.If an ESD is being charged, the power sign is shown as negative, and if energy is supplied, the sign is positive.Moreover, it is assumed that the PV system always supplies the generated energy so, C pv (t) ∈ [0, 1] without the negative component.The life of the BB depends on its dis(charge) rate ( C − rate ), number of cycles, and depth of discharge ( DoD b ), DoD b = 1 − SoC b .Moreover, the discharge of pulse power from the battery-alone system significantly reduces its life 21 .Therefore, BB life can be improved by controlling its C − rate , SoC b , and discharging it without pulse current.For this, a set of constraints in Eq. (10) on P b (t) is applied defining the minimum and maximum power supplied or taken through the BB.Secondly, SoC b is restricted within the specified upper SoC u b and lower SoC l b values given in Table 3.Furthermore, the pulse load that is greater than the BB discharging limit ( P dem > P dlim b ) is directed to the UC.
Here, P clim i is the maximum charging limit of the components and P dlim i is the maximum power that can be supplied to the load by the components.The PV system does not consume energy, so P clim pv = 0 .Moreover, it always supplies the maximum energy available, so P dlim pv = 1 .As mentioned above, UC energy storage can be controlled by its terminal voltage ( V uc ), and battery life can be improved by managing SoC b .Therefore, using V uc , SOC b , www.nature.com/scientificreports/P dem , and P pv with their limits in Eq. ( 10), the EML is defined by a set of IF-THEN rules.Table 1 represents the determined rules and Fig. 2 represents the flow chart of the defined rules.
The solution search space defined by EML is restricted to C i (t) ∈ [LB i , UB i ] , so PML decisions must be imple- mented within the search space, taking into account the load and available energy.PML defines online power allocations to components by controlling BDC i with the help of GOA using the search space.This is necessary to supply power to the PL without interruptions and deteriorating the component's performance.Therefore, the objective function is to minimize the difference between P dem and P i in the time interval j as in Eq. (11).
GOA is used to minimize the objective function.It produces the duty ratio signals d b and d uc to control BDC b and BDC uc , respectively.If d b is positive, then S b 1 ( 1 st MOSFET in BDC b ) is ON and the BB supplies energy to the load.If d b is negative ( db ), then S b 2 ( 2 nd MOSFET in BDC b ) is ON and the BB receives the charging current from the system.Similar is the case for d uc .The objective function can be rewritten as Eq. ( 12) The power P b (j) and P uc (j) can be calculated using Eqs.( 13) and (14) in which V oc b , V oc uc are the open circuit voltages and δ b , δ uc are the SoC gains of BB and UC, respectively, given in Table 3.
The second aspect is to track the MPP of the PV system under uniform and partially shaded conditions.GOA is used to generate a controlled duty ratio d of the boost converter using voltage and current as inputs.The power generated (P pv ) for a specific duty cycle d i using k th iteration and i th swarm number is defined as Eq. (15).where P pv is the power received for a specific d i at iteration number k for the i th GH in GOA.Here, d i is the posi- tion of i th GH that is to be optimized.The algorithm aims to find the optimal d that maximizes the power received by the system.At each iteration, the power received for a specific d (l) i is evaluated.This power value represents the fitness or objective value of the GH.The algorithm compares this power value in the current iteration k with the power value in the previous iteration k − 1 .The inequality in Eq. ( 15) serves as a criterion to determine whether the GHs have improved their positions (d) in terms of maximizing the power received.If the power received in the current iteration is greater than the power received in the previous iteration, this implies that the GHs have made progress and have moved toward an optimal d.Repetition of this process over several iterations is key to moving GHs towards the optimal d and thus reaching the maximum output power target.

Set of rules
The EML foundation of the proposed EMS is a rule-based strategy using simple IF-THEN operators.The IF statement chooses various operational scenarios, and the THEN statement executes the modes.The scenario is the situation under which the operational mode is activated.The operational mode is the mechanism that decides where the actual energy is coming from or where it is going to the different system's components.
IF-THEN rules play a crucial role in defining the search space and guiding the optimization process.These rules are typically based on a set of conditions (IF part) and corresponding actions (THEN part).Specific examples and case scenarios are given below.
• Example 1: IF -the SOC b is below 20%.THEN -start charging the battery using the available energy source.
This rule ensures that the battery is always charged sufficiently to meet the power demands of the load.• Example 2: IF -the pulse load demand is high.THEN -increase the power discharge from the UCs.This rule ensures a steady power supply to meet peak pulse loads.These are just a few examples of how IF-THEN rules can be used to define the search space for an optimization algorithm.• Impact of the IF-THEN rules on the optimization process: Reduces the search space to improve the convergence speed of the optimization algorithm and eliminates infeasible solutions to improve the quality of the final solution.Bias the optimization algorithm towards specific regions of the search space to achieve specific objectives.For instance, in Example 1, the algorithm is biased towards solutions that maintain the SOC b above 20%.This can be useful for applications where a long battery life is essential.In Example 2, the algorithm is biased towards solutions that use the UCs to meet the peak demands of the pulse load.

PV2PL mode
PV2PL mode is used for energy transfer from a PV system to PL.This procedure is carried out using a boost converter with MPPT abilities, as demonstrated in Fig. 1.PV energy is consumed as a priority to power the load and to reduce the stress on the ESDs.The energy supplied PV 2PL_E varies in the following situations. (11)

Case IF condition THEN Mode
Idle Case: No Load Case: Over Load Case: Vol:.( 1234567890 www.nature.com/scientificreports/Situation 1: If P pv is sufficient to handle the P dem , then PV 2PL_E is equal to the energy required by the load equation ( 16).
Situation 2: If the generated P pv is greater than P dem , then P pv is equal to the energy supplied P dem plus the surplus energy that is used to charge the UC (mode PV2UC mode) and / or BB (mode PV2BB mode).The PV 2PL_E in this situation is given below by Eq. ( 17). ( 16) www.nature.com/scientificreports/Situation 3: If generated P pv is not enough to power the P dem alone, then the entire generated P pv and deficit amount of energy supplied by the UCs (mode UC2PL mode) and/or BB (mode BB2PL mode) is used to compensate P dem .The PV energy obtained in this case is given in Eq. (18).

PV2UC mode
Energy is transferred from PV to UCs abbreviated as PV2UC.When P pv is greater than P dem and the V uc is less than the upper voltage level V max uc , then this mode is activated.P pv utilization to charge the UCs is 2 nd priority after supplying P dem as explained in mode PV2PL.The energy supplied by PV to UC (PV 2UC_E) can be calcu- lated with the situations given below.
Situation 1: When P pv > P dem , then the surplus energy transferred to UC charging is the power required by the UC (Req_UC_Pwr) in time t given by Eq. (19).The Req_UC_Pwr cannot exceed the P clim uc .
Situation 2: In the no-load condition (P dem = 0) the available P pv is used to charge the ESDs.First, UC is given priority to be charged, and second, BB gets surplus energy through the mode PV2BB mode.The PV energy to charge UCs in this situation is given in Eq. ( 20).
Situation 3: In the regenerative case (mode PL2ESD mode), if the charging energy required by the UCs is greater than the regenerated energy, then the remaining energy to charge the UC is taken through P pv .The PV 2UC_E in Eq. ( 21)is the difference between the required UCs energy (Req_UC_Pwr) to the regenerative energy (Reg_Pwr) in time t.

PV2BB mode
In this mode, the BB gets charging energy from a PVS abbreviated as PV2BB.This mode is activated when the P pv is more than both the P dem and the energy required to charge the UC with the necessary condition SoC b < SoC max b .The priority of PV energy is to run the load, the second priority is to charge the UCs and the third priority is to provide energy to BB.The energy supplied by PV to BB (PV 2BB_E) can be calculated using different situations.
Situation 1: When generated P pv is more than P dem and Req_UC_Pwr then the remaining energy is used to charge the BB in the system.The PV energy transferred to this situation is specified in Eq. (22).Situation 2: In the no-load condition (P dem = 0) the generated P pv is used to charge the UCs by means of mode PV2UC mode and the residual energy is used to charge the BB which is stated in Eq. (23).Situation 3: In regenerative situations (mode PL2ESD mode), in addition to regenerated energy, the available P pv is also utilized to charge the BB.PV energy in this situation is defined below in Eq. (24).

UC2PL mode
This mode allocates energy from UCs to PL, abbreviated as UC2PL.The minimum condition to trigger the mode is V uc > V min uc , that is, the terminal voltage of the UCs should be higher than their lowest cutoff voltage.The energy supplied by the UCs to PL (UC2PL_E) varies under different conditions.
Situation 1: When the difference between the P dem and P pv is greater than the upper BB discharge limit ( P dlim b ) then the remaining energy is supplied by the UC to the PL.The energy transferred to the PL by the UC is given in Eq. ( 25).
Situation 2: When P pv = 0 and SoC b = SoC min b then the energy supplied by the UC to the PL is as Eq. ( 26).

BB2PL mode
The BB is the main ESD to supply the power to the load abbreviated as BB2PL.This is valid when SoC b > SOC min b , i.e. the state of charge of the BB is higher than the cutoff SoC min b .The energy supplied by BB to PL (BB2PL_E) varies under different conditions.www.nature.com/scientificreports/Situation 1: When the P pv is not enough to run the load alone and ( P dem − P pv < P dlim b ), then the BB provides the energy deficiency to the loads computed as Eq. ( 27).Situation 2: When the condition ( P dem − P pv > P dlim b ) is satisfied then UCs help to provide the power to the PL and some of the energy is supplied by the BB to the PL as in Eq. ( 28).

BB2UC mode
Most published research work has not considered UC charging through the BB in HESS.The UC charging is done by an external energy-providing source such as PV energy, wind energy, and gas turbines, etc.To handle pulses in the load current, it is necessary to ensure the availability of UC energy.Therefore, this mode (BB2UC) is employed here to charge UCs through BB within the system so that the UC energy is mostly available to drive the PL.The initiation of this mode begins when the UC voltage is less than its threshold level V uc < V th uc , i.e., V uc is dropped from the allowable threshold voltage level.The energy supplied by BB to UCs (BB2UC_E) varies under different conditions.Moreover, the required UC power (Req_UC_Pwr) cannot exceed P clim uc .Situation 1: In the idle case where there is no P dem and no P pv the UCs get the following charging energy through the BB if SoC b > SOC th b .
Situation 2: If the generated P pv is enough to power the P dem alone, then the UCs get the following charging energy (Eq.30) through the BB.
Situation 3: When the difference between the P dem and P pv is less than P dlim b , V uc < V th uc and SoC b > SoC th b then the UCs are charged by the following energy Eq. ( 31).

PL2ESD mode
The proposed system can also work for EVs.During the deceleration of the EVs ( P dem < 0 ), the energy is supplied back to ESD.Therefore, to store this regenerated energy (Reg_Enr) in the ESD, this PL2ESD mode is included.At first priority, the UCs take the Reg_Enr when V uc < V max uc .The energy supplied by PL to ESDs varies under different conditions.
Situation 1: In the regenerative case where P dem > P clim uc , the energy is transferred to UCs by Eq. (32).
Situation 2: In the regenerative case where P dem < P clim uc , the energy is transferred to UCs by Eq. (33).
Situation 3: In the regenerative case where V uc = V max uc or Reg_Pwr > P clim uc then BB is charged by Reg_Enr given in Eq. (34).

OFF mode
There is a complete shutdown of the system when Situation 1: In the idle case ( P dem = P pv = 0 ) where V uc > V th uc then the system goes to the OFF position.Situation 2: In the case without load ( P dem = 0 and P pv > 0 ) when V uc = V max uc and SoC b = SoC max b then the system goes to the OFF position.
Situation 3: The system goes to the OFF position when P pv = 0 , V uc = V min uc , and SoC b = SoC min b .

Grasshopper optimization algorithm
GOA is a recently developed population-based swarm intelligence method that simulates the social interaction and food search behavior of grasshoppers (GHs) 37 .They go through two stages in life; nymph and adult.The nymphs move slowly since they lack wings and consume all the plants in their path.Adult GHs have wings that form a swarm in the air that can quickly move to a wide area.Swarm activity in both nymphs and adults is what makes it special.Slow movement in small steps in the nymph stage is known as exploitation.The movement of large distances in the adult stage in a larger search space is known as exploration.The region where exploitation and exploration are equal is called the comfort zone.The position χ i of i th GH is given by Eq. (35)  www.nature.com/scientificreports/g is the gravitational constant with its unit vector êg , u is the drift constant caused by the wind with its unit vector êw , d ij is the distance between the i th and j th GH, N is the total GHs.ψ represents the attraction and repulsion forces between the GHs given below Eq. ( 36) 40 .
The terms α and β stand for the length scale of attraction and the intensity of the attraction, respectively, at distance γ .The previous Eq. ( 35 is written as Eq. ( 37) to stop the GHs from immediately entering their comfort zone 41 .
ν u , ν l are the upper and lower limits of GH, Td is the target value in dimension d th .The parameter ζ is a decreas- ing coefficient, responsible for controlling the comfort zone and keeping a balance between exploration and exploitation.
ζ u , ζ l are the maximum and minimum values, k is the current iteration, and K is the maximum number of itera- tions.Figure 3 shows the flow chart of the dynamic power shared by the GOA.At first, the GOA takes inputs from the operational modes defined by rule-based control as shown in Fig. 2, that is, C pv , C b , C uc .It takes the other inputs such as P dem , P pv , SoC b , V uc and initializes all the variables.The GOA randomly generates the initial position of each GH which is a potential solution to the optimization problem.It evaluates the objective function in Eq. ( 12) and calculates the initial output values related to all GH and assigns the best fit values to d b and d uc as target positions.The algorithm completes the iterative cycle using the equations shown in the Fig.

Rule-based GOA
A rule-based control (RBC) system utilizes a set of rules expressed in a logical format, such as the IF-THEN statements, to make decisions about how to control a given system.The RBC then uses these rules to determine the appropriate control actions based on the current state of the system.RBC is commonly used in complex systems where developing a mathematical model is difficult or impossible.Moreover, it is well-suited for applications where the control rules need to be transparent and easy to understand.Combining RBC and GOA for the solar-powered BB-UC hybrid energy system driving pulsed load has several benefits.
• Exploration and exploitation: The combination of RBC and GOA allows a balance between exploration and exploitation.The RBC defines guidelines for exploitation, while GOA explores the parameter space to improve the control strategy.• Versatility and adaptation: RBC and GOA can adapt to different solar and load conditions through appropri- ate rules and an effective response system, respectively.• Global optimization: The GOA enables the HESS to find the best operational points by considering variations in solar irradiance and pulsed loads, maximizing the utilization of PV energy.• Deterministic and robust behavior: The use of RBC ensures that control actions are determined and unaf- fected by changes in system dynamics and external disturbances.Meanwhile, GOA provides an extra layer of robustness by optimizing the rules' parameters and dealing with uncertainties.When combined, these techniques ensure reliable and consistent management of pulsed loads using a solar-powered HESS.• Flexibility: RBC are flexible and easily adaptable to new situations and requirements.GOA can further improve flexibility by adapting to different operating conditions.
Overall, combining the advantages of RBC and GOA is a comprehensive approach to controlling and optimizing solar-powered BB-UC HESS with pulsed loads.It can help to address the challenges posed by pulsed loads while maximizing the utilization of PV energy and ensuring reliable performance.
The RB-GOA has several advantages over other SITs due to its inherent features, which include: • Robustness to noise: RB-GOA utilizes GOA, which maintains robustness even when some solutions are influenced by noise.• Ability to learn complex relationships: RB-GOA effectively captures complex and non-linear relationships between input and output variables.• Scalability to high dimensions: RB-GOA uses a divide and conquer approach to handle high-dimensional data sets.It breaks down the problem into subproblems of lower dimensions, thereby maintaining performance even in high-dimensional spaces. (

Parameters selection of SITs
The effective optimization of any technique often depends on the careful selection of its parameters.These parameter values and equations are sourced from established literature for each algorithm to ensure the robustness and reliability of the optimization approach.Table 2 provides the details about the parameter values of SITs with their equation and the source.For the CSA, these are obtained from 42 .They are essential for guiding the algorithm in its search for optimal solutions.Similarly, the SSA relies on parameters and equations borrowed from 43 , ensuring operation with well-defined settings.Furthermore, randomness is added through the variable c 2 , which helps to explore the solution space more effectively.GWO takes its parameters and equations form 44 which shows that the GOW linearly decreases α from 2 to 0.5 over time.Such adjustments help to improve the performance of the algorithm during the optimization process.In summary, this research is based on a thorough understanding of algorithms and their associated parameters, ensuring that the optimization approach is wellinformed and capable of producing accurate and reliable results.Moreover, in the experimental setup, the MATLAB version R2021a was used for data analysis and simulations.The computations were performed on a laptop featuring an Intel Core i5-6300U CPU, clocked at 2.40GHz with four processing cores, operating at approximately 2.5GHz.The laptop was equipped with 8192MB of RAM, providing the necessary computational resources to run the MATLAB simulations and ensure efficient data analysis.

Results and discussions
A simple model in Fig. 1 is taken to assess the viability of the proposed algorithm.It consists of a PV array with MPPT capability using a boost converter, a BB with its BDC b and UC bank with its BDC uc .The PV array gener- ates I pv and V pv upon receiving the irradiance from the visible light spectrum.The boost converter increases www.nature.com/scientificreports/V pv to V dclink .The ripple current required by MOSFET's ON/OFF is provided by C pv inserted between the PV array and the converter.GOA is used to track the MPP of the system by monitoring I pv and V pv .Six Sun-Power modules (SPR-315E-WHT-D) are utilized to provide a maximum P pv of 1.89 kW in the system.A shaded and an unshaded PV array condition is taken to evaluate PV performance.The EML is controlled by a simple RB technique in which the inputs specified in Table 3 are P pv , P dem , SoC b , SoC min b , SoC th b , V uc , V min uc and V th uc .Here, SoC min b is the minimum allowable SoC b after which the system cannot take the power from BB and SoC th b is the threshold SoC b after which it cannot charge the UC but can drive the load.Similarly, V min uc is the minimum terminal voltage of the UC after which it cannot supply power to the load and V th uc is the voltage level after which it can take power from the BB.The RB method performs the actions given in "Set of rules" section and Table 1.It generates the output C pv , C b , and C uc that are fed to PML that uses GOA to optimize the objective function in Eq. (12).The system is assessed for PV alone without ESD, PV with MPP tracking, constant load variable PV, and varying load variable PV cases.

PV alone without ESD
The evaluation of the system is conducted without establishing any connection between an ESD and PV array.Figure 4a depicts that the PV system supplies a relatively consistent portion of the load within the prescribed limits.However, when a PL is directly applied at 1 s and 6 s, the system fails to sustain the load.It is due to the fact that the response of the array is slow, and the load pulse is greater than its capacity.Capacity can be increased by adding more PV modules, but it adds cost and weight to the system.Furthermore, if the system is designed solely on the basis of the PL requirements, any surplus energy generated during periods of reduced Table 2. Parameters and equations of the algorithms 32 .
Modes: PV2PL, BB2PL 2-3 PV runs the load alone as P pv = 1.8kW > P dem and excess energy is stored in UC.
Modes: PV2PL, PV2UC www.nature.com/scientificreports/load will end up being wasted.In contrast, even if the capacity is expanded without cost and weight constraints, the ecological conditions persist.The system without ESD exhibits instability when subjected to low irradiance and shading conditions while the load is active.Therefore, it is strongly recommended to incorporate an ESD in the PV System to store excess energy during low-load scenarios and to serve as an energy source during low irradiance and PL demands.

Variable PV with constant load
The proposed system is tested for a constant P dem of 1.5 kW with variable P pv as shown in Fig. 5a.In the initial 1 s, P pv = 0 and P dem > P dlim b (the power demand exceeds the maximum power discharge limit of the BB); therefore, both the BB and the UC supply power to meet the load demand.The RB sets the values of C pv ∈ [0,0], C b and C uc ∈ [0,1] by enabling the BB2PL and UC2PL modes.The GOA takes this input from RB and optimizes the objective function by distributing power between BB and UC.It can be seen that the BB only provides power within its limits ( P dlim b = 1.0 kW ) while the remaining power is supplied by the UC ( P uc ).In the time interval 1 to 2 s, P pv is 1 kW but it is still insufficient to meet the P dem .As the primary priority of PV system is to power the load, the PV2PL mode is activated.Furthermore, the BB2PL mode is also activated because the other condition P dem − P pv < P dlim b is satisfied.The RB assigns values of C pv and C b ∈ [0,1] and C uc ∈ [0,0].GOA distributes P dem between PV and BB.Consequently, all P pv is used to run the load and the remaining required power is delivered by BB ( P b ).It is evident that P pv = 1 kW , P b is reduced to 0.5 kW and the P uc becomes zero.Furthermore, between 2 and 3 s, when P pv reaches 1.8 kW, the condition P dem < P pv is satisfied.This activates PV2PL as the first priority and initiates the PV2UC mode to store excess energy as P dem − P pv < P clim uc .The range of capacity factors is C pv ∈ [0,1], C b ∈ [0,0], and C uc ∈ [-1,0].The GOA assigns P pv to meet P dem , P uc to charge the UC, and P b to zero.At the last interval, the load is solely powered by P pv in the PV2PL mode as P dem = P pv .In this situation, BB provides charging to the UC using the BB2UC mode.Table 4 presents the summary of system operation for this case.
Figure 5b depicts the power delivered by various SITs for the variable PV constant load case, where RB-GOA is compared with CSA, GWO and SSA.The results demonstrate the effectiveness of the proposed system in maximizing PV energy utilization and improving UC response during charging/discharging to alleviate stress on BB.For example, as P pv increases from 0 to 1 kW at 1 s, the BB reduces its discharging current and the UC shuts down its operation to fully use the available PV energy.The results demonstrate that the system experiences a substantial power surge during this mode transition at 1 s.In the case of CSA, the power surge of 0.45 kW lasting for 6.9 ms.For GWO, the surge is 0.39 kW lasting for 7.2 ms, while for SSA the surge is 0.18 kW lasting for 11.2 ms.In contrast, the RB-GOA exhibits fewer oscillations compared to other SITs with only a 0.05 kW power surge for 3.5 ms.The analysis shows that the proposed RB-GOA outperforms the other SITs by reducing power surge by 26% compared to CSA, 22% compared to GWO, and 8% compared to SSA.Furthermore, the oscillations in RB-GOA diminish twice as fast as in CSA and GWO, and more than three times as fast as in SSA.These results highlight the superiority of the RB-GOA over other SITs in minimizing power fluctuations during the mode transition and maintaining stable output across the load.Table 5 presents the comparison of the proposed RB-GOA with the other SITs for this case.

Variable PV with pulse load
The proposed system is tested for a variable P dem of 0 to 3.5 kW with a variable P pv from 0 to maximum 1.89 kW as shown in Fig. 6a.
It can be seen that the system operates in an idle case ( P pv = P dem = 0 ) during the initial 1 s.The RB estab- lishes the values of the capacity factors C pv ∈ [0,0], C b ∈ [0,1], and C uc ∈ [-1,0].Furthermore, it activates the BB2UC mode, leading to the charging of the UC by the BB, which is managed by RB-GOA.In the time interval between 1 and 2 s, the P pv increases from 0 to a maximum of 1.89 kW and P dem = 0 .This activates the no-load case, in which the UC charging is given the highest priority activating the PV2UC mode.Moreover, P pv is more than the upper limit of the UC's charging threshold ( P clim uc ) so, the PV2BB mode is also enabled to take maximum advantage of available P pv .RB adjusts the values of C pv ∈ [0,1], C b and C uc ∈ [-1,0].RB-GOA distributes the available P pv between the UC and BB, enabling the simultaneous charging of both ESDs using the entire output power of the PV source.Furthermore, when P dem increases to 1.5 kW at 2 s, the condition P dem < P pv is satis- fied which activates PV2PL in the first priority.Additionally, to store excess energy PV2UC mode is initiated as the available PV power is more than load demand and the condition P pv − P dem < P clim uc is satisfied.The range of capacity factors is set to C pv ∈ [0,1], C b ∈ [0,0], and C uc ∈ [-1,0].The RB-GOA is responsible for dividing P pv between P dem to satisfy the priority load demand and P uc to charge the UC.There is no remaining power, so P b is zero.In the subsequent time intervals 3 to 4 s, P pv decreases to a point that condition P dem > P pv becomes valid.This is the overload case in which P pv alone is insufficient to power the load.Therefore, RB-GOA takes all the available P pv and the remaining required power ( P dem − P pv ) from BB to meet the load demand.UC does not participate in the situation where the difference between P dem and P pv ) is less than the battery discharge limit ( P dem − P pv < P dlim b ).In this case, the two modes PV2PL and BB2PL are activated.An instant surge of P dem reaching 3.5 kW is observed at 4 s which is greater than the available ( P pv ) and the discharge limit of BB ( P dlim b ).Pulse power demand with P pv = 0 .UC handles the power surge Modes: UC2PL, BB2PL 8-9 P dem is run by UC and BB as P pv = 0 .RB-GOA distributes power share between ESD within their limits Modes: UC2PL, BB2PL www.nature.com/scientificreports/Thus, UC handles this surge in P dem .In this situation, the three sources (PV, BB, and UC) are contributing to running the load, activating the PV2PL, BB2PL, and UC2PL modes with C pv , C b , and C uc ∈ [0,1].The RB-GOA distributes P dem among PV, BB, and UC based on their predefined limits.Moving on to the next interval (5 to 6 s), the equality case is considered in which P dem = P pv .In this case the load is solely run by P pv in PV2PL mode.At the same time, the BB charges the UC in the BB2UC mode.A regenerative case occurs in the time interval from 6 to 7 s in which P dem < 0 .During this interval, all P dem and P pv are used to charge the UC on priority.Since the regenerative energy and available PV energy ( |P dem | + P pv ) exceeds the UC charging limit P clim uc , the BB also receives charging.In this case, the operating modes are PL2ESD and PV2UC, where C pv ∈ [0,1], C b and C uc ∈ [-1,0].For the following time intervals (7 to 9 s), P pv = 0 and P dem hold different values.The RB-GOA distributes the power share between UC and BB within their limits, as PV power is not available.In the final time interval, both P dem and P pv become 0. Therefore, the BB provides charging to the UC with the BB2UC mode.Table 6 presents the summary of system operation for this case.
Figure 6b illustrates the power delivered by the different SITs for variable PV with variable load case.These results highlight the effectiveness of the proposed system in maximizing PV energy utilization and improving the UC response during charging and discharge, thus reducing the stress on the BB.As an example, as P pv increases from 0 to 1.89 kW, the UC receives a higher charging current, and the BB switches from discharging to charging mode to fully utilize the PV energy.The performance of the RB-GOA is compared with other SITs such as CSA, GWO, and SSA during this mode-change operation.The results demonstrate that the CSA exhibits a high surge in output power of 1.75 kW, GWO experiences a surge of 1.65 kW, and the SSA encounters a surge of 1.2 kW for 12 ms.In contrast, the RB-GOA exhibits fewer power oscillations with power surges of only 0.2 kW lasting for 5.5 ms.The analysis shows that the proposed RB-GOA outperforms the other SITs by significantly reducing power surges, achieving a 9-fold reduction compared to CSA and GWO, and a 6-fold reduction compared to SSA.Furthermore, the oscillations in RB-GOA diminish twice as fast as those in CSA, GWO, and SSA.These results highlight the superiority of the RB-GOA over other SITs in minimizing power surges during the mode transition and maintaining stable output across the load.Table 7 presents the comparison of the proposed RB-GOA with the other SITs for this case.
Figure 7 presents the graphical representation of the results obtained for variable PV with constant load and variable PV with pulse load cases.Figure 7a shows the comparison of power surges (kW) appeared in optimization processes during load transition for both cases using SITs.Furthermore, the surge die-out time (ms) for the same set of optimization techniques during load transitions is presented in Fig. 7b.The graph provides insight  www.nature.com/scientificreports/ • Improved MPPT speed: Achieving maximum energy from PV arrays requires a faster MPPT speed.EMS optimizes the process, ensuring energy generation closely follows solar irradiance changes, maximizing PV system efficiency.• Efficient integration of PV energy with ESDs: Efficient integration of PV energy with BB and UCs is a signifi- cant step toward ensuring a stable and sustainable energy supply.EMS regulates energy flow among these components, enhancing the overall efficiency of the system.• Adaptation to dynamic PV systems: The inclusion of both long-term energy management and short-term power management in EMS allows it to adapt dynamically to the ever-changing nature of PV systems and loads.This adaptability ensures a consistent energy supply, particularly in variable weather conditions.• Optimized real-time power sharing: The proposed approach optimizes real-time power sharing among PV, BB and UCs, promoting efficient energy utilization and minimizing waste.• Fresh perspective on SITs in BB-UC hybrid systems: This work provides a new perspective on the application of SIT in solar-powered BB-UC hybrid systems, offering advanced solutions to energy management challenges in such setups.
The physical significance of this research lies in its practical applicability to real-world energy systems.It incorporates a control mechanism that introduces damping in the system during load transitions, similar to shock absorbers in a vehicle.This physical damping reduces the rate of change of power, effectively reducing the surges and oscillations in the system.Additionally, UCs act as an energy buffer, rapidly releasing and absorbing energy to maintain system stability during a load transition.This inertia in energy transfer physically reduces the rapid changes in power.The proposed technique reduces power surges by providing UCs for the surge current to flow, allowing it to dissipate quickly and safely into the system.It can be used in a variety of applications, including power grids, industrial motors, wind turbines, and PV systems.

Conclusion
The proposed EMS based on RB-GOA to support pulse load exhibits outstanding performance compared to CSA, GWO, and SSA in terms of reducing power surges during load transition, mitigating oscillations, and achieving faster MPPT speed.It reduces power surges by 26% compared to CSA, 22% compared to GWO, and 8% compared to SSA during load transitions in the variable PV constant load case.It also mitigates oscillations twice as fast as CSA and GWO, and more than three times as fast as SSA.In the variable PV variable load case, it shows a significant reduction in power surges by 9 times compared to CSA and GWO, and by 6 times compared to SSA.Additionally, it achieves approximately 61% faster MPPT speed than CSA, 35% faster than GWO, and 29% faster than SSA, regardless of weather conditions.The work efficiently addresses challenges of high response times, output fluctuations, and integration of PV with ESDs.It efficiently regulates energy flow among PV systems, BB, and UCs using an EMS.The EMS includes both long-term energy management and short-term power management to adapt to the dynamic nature of PV systems.Furthermore, RB-GOA optimizes real-time power sharing among energy components and provides a fresh perspective on SITs in BB-UC hybrid systems.Moreover, an optimized MPPT scheme maximizes the energy harvesting from the PV array and mitigates the effect of varying solar irradiance.This multifaceted contribution offers valuable information on improving the performance and reliability of solar-powered BB-UC HESS under dynamic real-world conditions.

Figure 2 .
Figure 2. Operation control of proposed EMS.

Figure 5 .
Figure 5. (a) P dem distribution among P pv , P b , P uc under variable PV with constant load case, (b) comparison of power delivered by SITs.
and UC supply power to load as P pv = 0 and P dem > P dlim b .Modes: BB2PL, UC2PL 1-2

Figure 6 .
Figure 6.(a) P dem distribution among P pv , P b , P uc under variable PV with variable load conditions, (b) comparison of power delivered by SITs.

Table 3 .
Energy resources characteristics.

Table 4 .
Summary of system operation for variable P pv with constant P dem case.

Table 5 .
Comparison of SITs for variable P pv with constant P dem case.

Table 6 .
Summary of system operation for variable P pv with variable P dem case.
Overload case as P pv is insufficient.BB provides the balance power as P dem − P pv > P dlim

Table 7 .
Comparison of SITs for variable P pv with variable P dem case.